/*
 * @Author: 梓岄 3049738225@qq.com
 * @Date: 2025-11-20 14:18:20
 * @LastEditors: 梓岄 3049738225@qq.com
 * @LastEditTime: 2025-11-20 18:17:15
 * @FilePath: /named_pipe/Server.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include"Pipe.hpp"


int main()
{
    Fifo fileserver;
    fileserver.Bulid();
    fileserver.Open(ForRead);
    std::string msg;

    int i=3;
    // while(i--)
    while(true)
    {
        int n=fileserver.Recv(msg);
        if(n>0)
        {
            std::cout<<msg<<std::endl;
            msg.clear();
        }
        else
            break;
        // std::cout<<i<<std::endl;
    }

    fileserver.Delet();

    return 0;
}